package com.zy.datareceiver.core.common;

import java.util.Optional;

public class Tuple2<A,B> extends Tuple {
    private A a;
    private B b;
    public Tuple2(A a,B b){
        this.a = a;
        this.b = b;
    }

    @Override
    public <A> Optional _1() {
        return Optional.ofNullable(a);
    }

    @Override
    public <B> Optional _2() {
        return Optional.ofNullable(b);
    }

    @Override
    public <C> Optional<C> _3() {
        return Optional.empty();
    }

    @Override
    public <D> Optional<D> _4() {
        return Optional.empty();
    }

    @Override
    public <E> Optional<E> _5() {
        return Optional.empty();
    }
}
